﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace WpfApp_Autofac.Base;

public class Command : ICommand
{
    public event EventHandler? CanExecuteChanged;

    Action<object?> ExecuteAction;

    public Command(Action<object?> action)
    {
        ExecuteAction = action;
    }

    public bool CanExecute(object? parameter)
    {
        return true;
    }

    public void Execute(object? parameter)
    {
        ExecuteAction?.Invoke(parameter);
    }
}
